<template>
  <div class="menu_auth-wrapper">
          <switcher  @to_switch="to_switch" :fval="show_swtich"  :name="field.name" :show_text="[ '显示' , '隐藏']"></switcher>
      <transition name="fade">
        <menu_group v-show="show_swtich" :is_auth="true" @set_menu_auth="set_menu_auth"></menu_group>
      </transition>
  </div>
</template>

<script type="text/ecmascript-6">
  import tool from 'src/util/tool';
  import util from '_util/index';
  import logic from '_logic';

  import menu_group from 'components/edit/menu_group'
  import switcher from 'components/common/switcher'


  export default {
    data() {
      return {
        val: '',
          show_swtich:false
      }
    },
    components: {menu_group,switcher},
    methods: {
        to_switch(val){
            this.show_swtich = val;
        },
        set_menu_auth(menu_auth){
//            tool.cl('menu_auth', menu_auth);
            this.val = menu_auth;
        }
    },
    watch: {
      val: function (val, old) {
        if (val != old) {
          this.$emit('setVo', this.field.name, val)
        }
      },
    },
    computed: {},
    props: ['field'],
    created() {
    },
    mounted() {
    }
  };
</script>

<style lang="less" rel="stylesheet/less" scoped>
    @import "../../../common/style/mixin";
    .fade-transition();
</style>
